package com.chuangtie.secondary.lining.common.exception;


import com.chuangtie.secondary.lining.common.response.OpenResponseCode;

/**
 * @author : liaozhiwei
 * @date : 23:25 2024/7/8
 */
public class OpenException extends RuntimeException {
    private static final long serialVersionUID = -3008701086164361883L;

    private int code;

    private String description;


    public OpenException(int code, String description, Throwable cause) {
        super(description, cause);
        this.code = code;
        this.description = description;
    }

    public OpenException(int code, String description) {
        super(description);
        this.code = code;
        this.description = description;
    }
    public OpenException(OpenResponseCode responseCode, String description) {
        super(description);
        this.code = responseCode.getCode();
        this.description = description;
    }

    public OpenException(OpenResponseCode responseCode, Throwable cause) {
        super(responseCode.getDescription(),cause);
        this.code = responseCode.getCode();
        this.description = responseCode.getDescription();
    }

    public OpenException(OpenResponseCode responseCode) {
        super(responseCode.getDescription());
        this.code = responseCode.getCode();
        this.description = responseCode.getDescription();
    }

    public OpenException() {
        super();
    }

    public OpenException(String message, Throwable cause) {
        super(message, cause);
    }

    public OpenException(Throwable cause) {
        super(cause);
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
